package com.vito.dcs.asphalt.pore.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.vito.base.factory.IDFactory;
import com.vito.base.model.DataGrid;
import com.vito.dcs.asphalt.pore.dao.MixAsphaltPoreMapper;
import com.vito.dcs.asphalt.pore.model.MixAsphaltPoreModel;
import com.vito.dcs.asphalt.pore.service.MixAsphaltPoreService;

@Service
public class AsphaltPoreServiceImpl implements MixAsphaltPoreService {

    @Autowired
    private MixAsphaltPoreMapper mixAsphaltPoreMapper;

    @Override
    public Integer saveMixAsphaltPore(MixAsphaltPoreModel mixasphaltpore) {
    	Map<String,Object> map = new HashMap<String,Object>();
        map.put("id", IDFactory.getIDFactory().getIdInc()+"");
        return mixAsphaltPoreMapper.saveMixAsphaltPore(map);
    }

    @Override
    public Integer updateMixAsphaltPore(Map<String,Object> map) {
        return mixAsphaltPoreMapper.updateMixAsphaltPore(map);
    }

    @Override
    public MixAsphaltPoreModel queryMixAsphaltPore(MixAsphaltPoreModel mixasphaltpore) {
        return mixAsphaltPoreMapper.queryMixAsphaltPore(mixasphaltpore);
    }

    @Override
    public List<MixAsphaltPoreModel> queryMixAsphaltPoreByBlenderId(Map<String, Object> map) {
        return mixAsphaltPoreMapper.queryMixAsphaltPoreByBlenderId(map);
    }

    @Override
    public String queryAsphaltPoreBlenderId(String blenderId) {
        return mixAsphaltPoreMapper.queryAsphaltPoreBlenderId(blenderId);
    }

    @Override
	public DataGrid<MixAsphaltPoreModel> queryMixAsphaltPoreByPage(MixAsphaltPoreModel mixasphaltpore) {
		DataGrid<MixAsphaltPoreModel> dg = new DataGrid<MixAsphaltPoreModel>();
		dg.setRows(mixAsphaltPoreMapper.queryMixAsphaltPoreByPage(mixasphaltpore));
		dg.setTotal(mixasphaltpore.getTotal());
		return dg;
	}


}

